<html>
<head><meta charset="utf-8"><title>Building with CI scripts yields configure permission errors · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html">Building with CI scripts yields configure permission errors</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209223548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223548">(Sep 06 2020 at 12:32)</a>:</h4>
<p>Hi there, I am working on a PR to add aarch64-unknown-linux-musl support as a host enviroment.<br>
After I got musl to install fine inside the CI Dockerfile that I made, I'm now running into a weird error with the x.py script inside the server.<br>
For debugging, this is what it (the <a href="http://run.sh">run.sh</a> script) runs: <code>docker run --workdir /checkout/obj --env SRC=/checkout --env SCCACHE_DIR=/sccache --volume /home/jens/.cache/sccache:/sccache --privileged --volume /home/jens/rustsrc:/checkout:ro --volume /home/jens/rustsrc/obj:/checkout/obj --volume /home/jens/.cargo:/cargo --volume /home/jens/rustsrc:/home/jens/rustsrc --volume /tmp/toolstate:/tmp/toolstate --env LOCAL_USER_ID=1000 --env CARGO_HOME=/cargo --env DEPLOY --env DEPLOY_ALT --env CI --env TF_BUILD --env BUILD_SOURCEBRANCHNAME --env GITHUB_ACTIONS --env GITHUB_REF --env TOOLSTATE_REPO_ACCESS_TOKEN --env TOOLSTATE_REPO --env TOOLSTATE_PUBLISH --env CI_JOB_NAME= --init --rm rust-ci /checkout/src/ci/run.sh</code><br>
It keeps running into the following error (though when I run the container interactive and touch any file, it works fine):</p>
<div class="codehilite"><pre><span></span><code><span class="n">configure</span><span class="p">:</span> <span class="n">writing</span> <span class="err">`</span><span class="n">config</span><span class="o">.</span><span class="n">toml</span><span class="err">`</span> <span class="ow">in</span> <span class="n">current</span> <span class="n">directory</span>
<span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
  <span class="n">File</span> <span class="s2">&quot;/checkout/src/bootstrap/configure.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">455</span><span class="p">,</span> <span class="ow">in</span> <span class="o">&lt;</span><span class="n">module</span><span class="o">&gt;</span>
    <span class="k">with</span> <span class="n">bootstrap</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="s1">&#39;config.toml&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
  <span class="n">File</span> <span class="s2">&quot;/usr/lib/python3.8/contextlib.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">113</span><span class="p">,</span> <span class="ow">in</span> <span class="fm">__enter__</span>
    <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">gen</span><span class="p">)</span>
  <span class="n">File</span> <span class="s2">&quot;/checkout/src/bootstrap/bootstrap.py&quot;</span><span class="p">,</span> <span class="n">line</span> <span class="mi">325</span><span class="p">,</span> <span class="ow">in</span> <span class="n">output</span>
    <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">tmp</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="ne">PermissionError</span><span class="p">:</span> <span class="p">[</span><span class="n">Errno</span> <span class="mi">13</span><span class="p">]</span> <span class="n">Permission</span> <span class="n">denied</span><span class="p">:</span> <span class="s1">&#39;config.toml.tmp&#39;</span>
</code></pre></div>


<p>Does anyone have an idea what could help here? (I've disabled selinux inside the container, my host is a raspberry pi running fedora rawhide)</p>



<a name="209223572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223572">(Sep 06 2020 at 12:33)</a>:</h4>
<blockquote>
<p>--volume /home/jens/rustsrc:/checkout:ro</p>
</blockquote>
<p>This seems like the issue</p>



<a name="209223575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223575">(Sep 06 2020 at 12:33)</a>:</h4>
<p>is that a flag <a href="http://run.sh">run.sh</a> adds?</p>



<a name="209223622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223622">(Sep 06 2020 at 12:34)</a>:</h4>
<p>Yes, <a href="https://github.com/rust-lang/rust/blob/master/src/ci/docker/run.sh#L205">https://github.com/rust-lang/rust/blob/master/src/ci/docker/run.sh#L205</a></p>



<a name="209223667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223667">(Sep 06 2020 at 12:35)</a>:</h4>
<p>hmm maybe bootstrap should be using <code>/tmp</code> instead of the source directory</p>



<a name="209223670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223670">(Sep 06 2020 at 12:36)</a>:</h4>
<p>actually this would break anyway when it tries to replace the file, so that won't make a difference</p>



<a name="209223714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223714">(Sep 06 2020 at 12:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> any ideas?</p>



<a name="209223828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223828">(Sep 06 2020 at 12:39)</a>:</h4>
<p>uh, I am a bit confused, what exactly are you running?</p>



<a name="209223831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223831">(Sep 06 2020 at 12:39)</a>:</h4>
<p>src/ci/run.sh or src/ci/docker/run.sh?</p>



<a name="209223874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223874">(Sep 06 2020 at 12:40)</a>:</h4>
<p>./src/ci/docker/run.sh aarch64-musl</p>



<a name="209223885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223885">(Sep 06 2020 at 12:40)</a>:</h4>
<p>that docker container isn't in tree yet right?</p>



<a name="209223942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223942">(Sep 06 2020 at 12:42)</a>:</h4>
<p>I've added a new Dockerfile under host-aarch64 and the base image built successfully<br>
It is pretty much a copy of the dist-x86_64-musl one with a small GCC fix</p>



<a name="209223960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223960">(Sep 06 2020 at 12:43)</a>:</h4>
<p>hm, what is the SCRIPT you're setting?</p>



<a name="209223964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223964">(Sep 06 2020 at 12:43)</a>:</h4>
<p>python3 ../x.py dist --build $HOSTS<br>
HOSTS is aarch64-unknown-linux-musl</p>



<a name="209223992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209223992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209223992">(Sep 06 2020 at 12:44)</a>:</h4>
<p>hm yeah that looks right</p>



<a name="209224009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224009">(Sep 06 2020 at 12:44)</a>:</h4>
<p>I am trying to figure out why you're hitting this with musl but not gnu</p>



<a name="209224010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224010">(Sep 06 2020 at 12:44)</a>:</h4>
<p>(or any other docker)</p>



<a name="209224011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224011">(Sep 06 2020 at 12:44)</a>:</h4>
<p>or is that a wrong assumption, and you hit this always?</p>



<a name="209224027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224027">(Sep 06 2020 at 12:45)</a>:</h4>
<p>I did not test the other ones as a build of the base image to run takes a long while (about 5h?) on my poor raspberry pi. I would bet that I hit it with any of them</p>



<a name="209224037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224037">(Sep 06 2020 at 12:45)</a>:</h4>
<p>hm okay</p>



<a name="209224120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224120">(Sep 06 2020 at 12:47)</a>:</h4>
<p>presumably it's the read only mount causing problems, I guess</p>



<a name="209224175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224175">(Sep 06 2020 at 12:48)</a>:</h4>
<p>but it really shouldn't because configure is invoked in the top-level working directory which isn't mounted readonly</p>



<a name="209224179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224179">(Sep 06 2020 at 12:48)</a>:</h4>
<p>I wonder if this is a bug in docker or something on some platforms?</p>



<a name="209224184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224184">(Sep 06 2020 at 12:48)</a>:</h4>
<p>but I don't have any good ideas on how to debug</p>



<a name="209224250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224250">(Sep 06 2020 at 12:50)</a>:</h4>
<p>I think I've also tried removing the ro and it still wouldn't do it. I've added a <code>p(os.getcwd())</code> and that says /checkout/obj, means that /checkout/obj/config.toml.tmp should not be creatable? From what I see, <a href="http://run.sh">run.sh</a> inside the container is switching user? Maybe that's the issue</p>



<a name="209224289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224289">(Sep 06 2020 at 12:51)</a>:</h4>
<p>I know it "works" on CI and for me personally locally</p>



<a name="209224337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224337">(Sep 06 2020 at 12:52)</a>:</h4>
<p>it might be that something about the pi environment is just sufficiently different though</p>



<a name="209224348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224348">(Sep 06 2020 at 12:52)</a>:</h4>
<p><span class="user-mention" data-user-id="338253">@Jens Reidel</span> could you try the -gnu target and see if it works?</p>



<a name="209224349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224349">(Sep 06 2020 at 12:52)</a>:</h4>
<p>that would help debug</p>



<a name="209224350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224350">(Sep 06 2020 at 12:52)</a>:</h4>
<p>I guess you can try NO_CHANGE_USER=1</p>



<a name="209224353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224353">(Sep 06 2020 at 12:53)</a>:</h4>
<p>Seems the UID it runs as in the container is 1000 (mine on the host) yet the /checkout/obj is owned by root, that's it I guess</p>



<a name="209224357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224357">(Sep 06 2020 at 12:53)</a>:</h4>
<p>huh, interesting</p>



<a name="209224361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224361">(Sep 06 2020 at 12:53)</a>:</h4>
<p>so maybe the problem is that it <em>isn't</em> changing users</p>



<a name="209224375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224375">(Sep 06 2020 at 12:53)</a>:</h4>
<p>It is changing user, but the mount permission is a bit weird. I guess I might know a fix, I'll try that</p>



<a name="209224505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224505">(Sep 06 2020 at 12:57)</a>:</h4>
<p>If I tell it to keep the user in the container the same as on the host, the mount permissions are fine and NO_CHANGE_USER makes it not try to create a user that it is already. I guess that's good enough for me to test if this actually works :)</p>



<a name="209224611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224611">(Sep 06 2020 at 13:00)</a>:</h4>
<p>May I ask one more thing? In the build process it tries to download <a href="https://static.rust-lang.org/dist/2020-08-26/rustc-beta-aarch64-unknown-linux-musl.tar.xz.sha256">https://static.rust-lang.org/dist/2020-08-26/rustc-beta-aarch64-unknown-linux-musl.tar.xz.sha256</a> (which is 404 because as of now only std is available), tries again 5 times and exits. Why does it attempt that?</p>



<a name="209224648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224648">(Sep 06 2020 at 13:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="338253">Jens Reidel</span> <a href="#narrow/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors/near/209224611">said</a>:</p>
<blockquote>
<p>May I ask one more thing? In the build process it tries to download <a href="https://static.rust-lang.org/dist/2020-08-26/rustc-beta-aarch64-unknown-linux-musl.tar.xz.sha256">https://static.rust-lang.org/dist/2020-08-26/rustc-beta-aarch64-unknown-linux-musl.tar.xz.sha256</a> (which is 404 because as of now only std is available), tries again 5 times and exits. Why does it attempt that?</p>
</blockquote>
<p>it needs a bootstrap beta compiler</p>



<a name="209224688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224688">(Sep 06 2020 at 13:02)</a>:</h4>
<p>hmm this might be tricky ... you may need to cross-compile the first time</p>



<a name="209224769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224769">(Sep 06 2020 at 13:04)</a>:</h4>
<p>I am trying to add support for exactly such compiler <span aria-label="rolling on the floor laughing" class="emoji emoji-1f923" role="img" title="rolling on the floor laughing">:rolling_on_the_floor_laughing:</span> <br>
Are there instructions on cross compiling from an x86_64-unknown-linux-gnu host for aarch64-unknown-linux-musl?<br>
Overall I did not find a guideline for adding support for new architectures as host, i.e. more than stdlib. I initially asked this on the Discord yesterday and jynelson told me to start with this Docker image for CI and ask here on Zulip if I have more questions.</p>



<a name="209224860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224860">(Sep 06 2020 at 13:07)</a>:</h4>
<p>well I wouldn't recommend cross-compiling on a raspberry pi lol</p>



<a name="209224913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209224913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209224913">(Sep 06 2020 at 13:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> do you have a write-up anywhere of how to do this?</p>



<a name="209225114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225114">(Sep 06 2020 at 13:14)</a>:</h4>
<p>Yeah cross compiling would speed this up a lot; I went with the Pi since the folder is called "host-aarch64" so I assumed it'd be required to compile it on aarch64 hosts to get approval <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span>. I probably thought wrong, getting instructions on the proper way of doing this would be awesome!</p>



<a name="209225400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225400">(Sep 06 2020 at 13:22)</a>:</h4>
<p>In theory, you need a linker and the musl library, and you can then pass host and target flags for whatever triple and it should just work</p>



<a name="209225404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225404">(Sep 06 2020 at 13:22)</a>:</h4>
<p>I don't have a handy write-up though</p>



<a name="209225410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225410">(Sep 06 2020 at 13:23)</a>:</h4>
<p>hmm ... <span class="user-mention" data-user-id="116155">@Jake Goulding</span> when you did this for the new MacOS target, did you do host builds? or cross-compiling only?</p>



<a name="209225461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225461">(Sep 06 2020 at 13:24)</a>:</h4>
<p>Both</p>



<a name="209225478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225478">(Sep 06 2020 at 13:25)</a>:</h4>
<p>ok neat! do you happen to have instructions written down for that anywhere? ;) or even some shell scripts you came up with would be handy</p>



<a name="209225482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225482">(Sep 06 2020 at 13:25)</a>:</h4>
<p><a href="https://github.com/shepmaster/rust/blob/silicon-ci/silicon/README.md">https://github.com/shepmaster/rust/blob/silicon-ci/silicon/README.md</a></p>



<a name="209225530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225530">(Sep 06 2020 at 13:26)</a>:</h4>
<p><span class="user-mention" data-user-id="338253">@Jens Reidel</span> note that this will involve compiling rustc from source on your raspberry pi, which will probably take ... days</p>



<a name="209225538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225538">(Sep 06 2020 at 13:27)</a>:</h4>
<p>(if your pis are anywhere near as slow as the pis at my work)</p>



<a name="209225719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209225719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209225719">(Sep 06 2020 at 13:32)</a>:</h4>
<p>Compiling GCC on my Pi takes about 4-5h so I guess that's reasonable time</p>



<a name="209229495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209229495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209229495">(Sep 06 2020 at 15:20)</a>:</h4>
<p>Hi again, the cross compile worked fine until it errored now.</p>
<div class="codehilite"><pre><span></span><code>cargo:root=/rust/build/aarch64-unknown-linux-musl/llvm
    finished in 1290.724
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -&gt; aarch64-unknown-linux-musl)
error: cannot produce dylib for `rustc_driver v0.0.0 (/rust/compiler/rustc_driver)` as the target `aarch64-unknown-linux-musl` does not support these crate types
command did not execute successfully: &quot;/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo&quot; &quot;build&quot; &quot;--target&quot; &quot;aarch64-unknown-linux-musl&quot; &quot;-Zdual-proc-macros&quot; &quot;-Zbinary-dep-depinfo&quot; &quot;-j&quot; &quot;24&quot; &quot;--release&quot; &quot;--features&quot; &quot; llvm&quot; &quot;--manifest-path&quot; &quot;/rust/compiler/rustc/Cargo.toml&quot; &quot;--message-format&quot; &quot;json-render-diagnostics&quot;
</code></pre></div>


<p>I use the default config.toml and made these changes:</p>
<div class="codehilite"><pre><span></span><code>assertions = true
debug = true
incremental = true
host = [&quot;aarch64-unknown-linux-musl&quot;]
target = [&quot;aarch64-unknown-linux-musl&quot;]
musl-root = &quot;/usr/local/aarch64-linux-musl/&quot;
</code></pre></div>


<p>How do I fix this? musl does not support dylibs, but I wonder how the x86_64 musl target does this</p>



<a name="209229560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209229560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209229560">(Sep 06 2020 at 15:22)</a>:</h4>
<p>Musl does support dynamic linking if you dynamically link to musl itself.</p>



<a name="209229584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209229584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209229584">(Sep 06 2020 at 15:23)</a>:</h4>
<p>I used the <a href="https://github.com/richfelker/musl-cross-make/">https://github.com/richfelker/musl-cross-make/</a> thing to get a full aarch64 musl toolchain (just like the CI uses it). Does it have support for that?</p>



<a name="209229689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209229689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209229689">(Sep 06 2020 at 15:26)</a>:</h4>
<p>Try adding</p>
<div class="codehilite"><pre><span></span><code><span class="k">[target.aarch64-unknown-linux-gnu]</span>
<span class="n">crt-static</span> <span class="o">=</span> <span class="kc">false</span>
</code></pre></div>


<p>That may fix the problem.</p>



<a name="209229725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209229725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209229725">(Sep 06 2020 at 15:27)</a>:</h4>
<p>Thanks! I had tried with the env var value set before but apparently it did not apply :) It seems to continue the compile now</p>



<a name="209230140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209230140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209230140">(Sep 06 2020 at 15:39)</a>:</h4>
<p>rustc is done building in stage1 now, but I think I have a config logic issue. As I'm cross compiling, i need to build all the components for aarch64 on the x86 host (or is that wrong?). I seem to have a rustc binary now that is for aarch64, but it tries to build the stdlib for x86 with aarch64 rustc now.<br>
Is this the point where I just switch to the Pi with only rustc and try to compile the rest or can I somehow get this done as on x86 as well?</p>
<div class="codehilite"><pre><span></span><code>build = &quot;x86_64-unknown-linux-gnu&quot;
host = [&quot;aarch64-unknown-linux-musl&quot;]
target = [&quot;aarch64-unknown-linux-musl&quot;]
</code></pre></div>


<p>Might also be a logic issue here. It says it tries to compile each target with each host, but I do not have the x86 as a host. If I add x86 to the host list, it still tries to use the aarch64 rustc to build x86 stdlib</p>
<div class="codehilite"><pre><span></span><code>    Finished release [optimized + debuginfo] target(s) in 0.11s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / aarch64-unknown-linux-musl)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -&gt; aarch64-unknown-linux-musl)
    Finished release [optimized + debuginfo] target(s) in 0.17s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / aarch64-unknown-linux-musl)
Assembling stage1 compiler (aarch64-unknown-linux-musl)
Building stage1 std artifacts (aarch64-unknown-linux-musl -&gt; x86_64-unknown-linux-gnu)
error: process didn&#39;t exit successfully: `/rust/build/bootstrap/debug/rustc -vV` (exit code: 101)
--- stderr
thread &#39;main&#39; panicked at &#39;
Failed to run:
&quot;/rust/build/aarch64-unknown-linux-musl/stage1/bin/rustc&quot; &quot;-vV&quot; &quot;-Wrust_2018_idioms&quot; &quot;-Wunused_lifetimes&quot; &quot;-Dwarnings&quot; &quot;-Clinker=aarch64-linux-musl-gcc&quot; &quot;-C&quot; &quot;target-feature=-crt-static&quot; &quot;-Z&quot; &quot;force-unstable-if-unmarked&quot;
-------------: Os { code: 8, kind: Other, message: &quot;Exec format error&quot; }&#39;, src/bootstrap/bin/rustc.rs:152:22
</code></pre></div>



<a name="209231113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231113">(Sep 06 2020 at 16:05)</a>:</h4>
<p>Are you passing --stage 2?</p>



<a name="209231119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231119">(Sep 06 2020 at 16:05)</a>:</h4>
<p>it's probably <a href="https://github.com/rust-lang/rust/issues/76333">https://github.com/rust-lang/rust/issues/76333</a> which I'm working on a patch set for now</p>



<a name="209231348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231348">(Sep 06 2020 at 16:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> I am only invoking ./x.py build without any further arguments and incremental enabled (my options are somewhere above this thread)</p>



<a name="209231391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231391">(Sep 06 2020 at 16:12)</a>:</h4>
<p>--stage 2 seems to be doing <em>something</em>, not sure what</p>



<a name="209231730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231730">(Sep 06 2020 at 16:22)</a>:</h4>
<p>yes, stage 2 is what you probably want, or stage 1 but with src/rustc explicitly passed</p>



<a name="209231848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231848">(Sep 06 2020 at 16:26)</a>:</h4>
<p>I saw the file Jake linked earlier that explains how to build rust natively with the earlier cross compiled binaries. What would be the proper steps after cross compiling and then doing a native build to get this into upstream (i.e. rustup)?</p>



<a name="209231944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209231944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209231944">(Sep 06 2020 at 16:30)</a>:</h4>
<p>If we want to distribute with rustup, we'll need to find a builder to add this build to (i.e., one that has sufficient capacity currently).<br>
Presumably dist-arm-linux might be a good candidate -- it looks like it takes ~40 minutes right now.</p>
<p>You can submit a PR to rust-lang/rust adjusting the configuration of that builder to compile for this target as well.</p>



<a name="209232146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232146">(Sep 06 2020 at 16:34)</a>:</h4>
<p>Once we're building for the target you'll want to edit <a href="https://github.com/rust-lang/rust/blob/4b65872d272875adb298b6dc12d5e4e79cf8e263/src/tools/build-manifest/src/main.rs#L17">https://github.com/rust-lang/rust/blob/4b65872d272875adb298b6dc12d5e4e79cf8e263/src/tools/build-manifest/src/main.rs#L17</a> to include the triple in both hosts and targets</p>



<a name="209232156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232156">(Sep 06 2020 at 16:35)</a>:</h4>
<p>Just to clarify: It would require changing <a href="https://github.com/rust-lang/rust/blob/9a13ef2251531d5856ca62dd8822c9b8139f479a/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile">https://github.com/rust-lang/rust/blob/9a13ef2251531d5856ca62dd8822c9b8139f479a/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile</a> or would it require adding a new file (and if so, under host-aarch64 or host-x86_64)?<br>
As I see it, the Dockerfiles seem to provide the base required to run the SCRIPT enviroment variable that then builds the binaries, so I assume a new one would be required</p>



<a name="209232164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232164">(Sep 06 2020 at 16:35)</a>:</h4>
<p>no, you want to adjust dist-arm-linux/Dockerfile</p>



<a name="209232206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232206">(Sep 06 2020 at 16:36)</a>:</h4>
<p>each new docker file is a new builder and we don't have infinite parallelism, so we pack multiple things into one builder when possible</p>



<a name="209232211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232211">(Sep 06 2020 at 16:36)</a>:</h4>
<p>host-x86_64 is also good because that has much more capacity -- we currently only have one aarch64 host.</p>



<a name="209232329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jens Reidel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232329">(Sep 06 2020 at 16:40)</a>:</h4>
<p>Right - that means I'll have to add the musl installation and change the env vars, I assume. Is there any way I could test these changes (or are they automatically tested)? I don't have a 1:1 CI setup locally and I would like to make sure that the PR would actually work</p>



<a name="209232332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Building%20with%20CI%20scripts%20yields%20configure%20permission%20errors/near/209232332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Building.20with.20CI.20scripts.20yields.20configure.20permission.20errors.html#209232332">(Sep 06 2020 at 16:40)</a>:</h4>
<p>You should be able to run src/ci/docker/run.sh dist-arm-linux locally, and inspect/test the artifacts</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>